/**
 * \file       icon.cpp
 * \brief      define a class to icon the main window as icon on bar 
 * \version    1.0
 * \author     dragon,Fong's National Engineering Co. Ltd 
 * \date       2007-12-18
 * \remarks    there is initial Version
 * \bug        unknown
 * \todo       Icon the main window on the bar
 */
#include "dolphin.h"

extern dolphin *frame;

BEGIN_EVENT_TABLE(Icon, wxTaskBarIcon)
EVT_TASKBAR_LEFT_DCLICK(Icon::OnDClick)
EVT_MENU(wxID_EXIT,Icon::OnExit)
END_EVENT_TABLE()

void Icon::OnDClick(wxTaskBarIconEvent& event)
{
	 frame->Show(true);
}

wxMenu *Icon::CreatePopupMenu()
{
	 wxMenu *menu = new wxMenu;
	 menu->Append(wxID_EXIT,    _T("E&xit"));
	
	 return menu;
}

void Icon::OnExit(wxCommandEvent& event)
{
	 delete frame;
}
